package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.work.WorkEntryBO;
import com.ymk.service.IWorkEntryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-08-18
 */
@Service
public class WorkEntryService implements IWorkEntryService {

    @Override
    public WorkEntryBO get(Map param) {
    return this.daoRouter.queryForObject("WorkEntry.loadWorkEntry",param);
    }

    @Override
    public List<WorkEntryBO> list(Map param) {
        return this.daoRouter.query("WorkEntry.loadWorkEntry",param);
    }

    @Override
    public List<WorkEntryBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("WorkEntry.loadWorkEntryForPage",pagination);
    }

    @Override
    public void post(WorkEntryBO param) {
        this.daoRouter.insert("AWorkEntry.insertWorkEntry",param);
    }

    @Override
    public void update(WorkEntryBO param) {
        this.daoRouter.update("AWorkEntry.updateWorkEntry",param);
    }

    @Override
    public void del(WorkEntryBO param) {
        this.daoRouter.update("AWorkEntry.delWorkEntry",param);
    }

    public List<WorkEntryBO> downloadExcel(WorkEntryBO param) {
        return this.daoRouter.query("WorkEntry.downloadExcel",param);
    }
    @Autowired
    private DaoRouter daoRouter;

}
